package cus1156.lab6;

import java.util.ArrayList;

/**
 * Represents a list of cats
 * @author Bonnie MacKellar
 *
 */
public class CatList {
	private ArrayList<Cat> cats = new ArrayList<Cat>();
	
	/**
	 * add one cat to the list, at the last position
	 * @param cat - a Cat to be added
	 */
	public void addCat(Cat cat)
	{
		cats.add(cat);
	}
	
	/**
	 * return the number of cats in the list
	 * @return number of cats in the list
	 */
	public int howManyCats()
	{
		return cats.size();
	}

	/**
	 * return the cat at the ith position
	 * @param pos - the position whose Cat we want to return
	 */
	public Cat getCatAtPos(int pos)
	{
	   return cats.get(pos);
	}
	
	public String whatColorCat()
	{
		int counterBLK = 0;
		int counterCAL = 0;
		int counterORNG = 0;
		int counterBLU = 0;
		String color;
		
		for(int i = 0; i < cats.size(); i++)
		{
			switch(color)
			{
				case("black"):
					counterBLK += 1;
				break;
				
				case("calico"):
					counterCAL += 1;
				break;
				
				case("orange"):
					counterORNG += 1;
				break;
				
				case("blue"):
					counterBLU += 1;
				break;
				
				default:
					System.out.println("Invalid Color");
			}
					
		}
		return color; 
	}
	
	public Cat getCatByName(String nm){
		int first=0;
		int last=cats.size;
		for(int j=0; j<last; j++){
			if (cats.getName(j)==nm)
					return j;
			}return -1
		}
	}
}
